package org.ar.gameserver.map.main;

import org.ar.gameserver.common.exception.ExceptionType;
import org.ar.gameserver.common.exception.GameServerException;
import org.ar.gameserver.common.socket.ServerSocket;
import org.ar.gameserver.common.util.LogUtils;
import org.ar.gameserver.common.util.PropertiesUtils;
import org.ar.gameserver.map.server.MapServerHandler;

public class ExecuteManager {

	private static int mapBindPort;
	
	static {
		try {
			PropertiesUtils.load("E:/arg.properties");
			mapBindPort = Integer.parseInt(PropertiesUtils.getProperty("map.Bind.Port"));
		} catch (Exception e) {
			LogUtils.error(e);
		}
	}
	
	public ExecuteManager() throws GameServerException {
		try {
			ServerSocket mapServer = new ServerSocket();
			mapServer.start(new MapServerHandler(), mapBindPort);
		} catch (Exception e) {
			throw new GameServerException(ExceptionType.EX_3, e);
		}
	}
}
